from selenium.webdriver.common.by import By


class PageElements:
    """后台管理 -登录"""
    # 用户名
    mis_login_account_name = (By.NAME, "username")
    # 密码
    mis_login_password_name = (By.NAME, "password")
    # 登录按钮
    mis_login_submit_btn_id = (By.ID, "inp1")
    # 登入确认
    mis_login_confirm = (By.XPATH, '//div[contains(@class,"user_info")]/span[contains(text(),"管理员")]')


    """后台管理 -首页"""
    # 信息管理
    mis_home_information_manage_xpath = (By.XPATH, "//a[text()='信息管理']")
    # 内容审核
    mis_home_content_audit_xpath = (By.XPATH, "//a[text()='内容审核']")

    # 文章名称
    audit_title = (By.CSS_SELECTOR, 'input[placeholder="请输入: 文章名称"]')
    # 选择结束时间
    audit_over_time = (By.CSS_SELECTOR, 'input[placeholder="选择结束时间"]')
    # 时间+1 月末之前
    audit_add_day_before = (By.XPATH, '//td[contains(@class,"available")]//span[contains(text(),"{}")]')
    # 时间+1 月末之之后
    audit_add_day_after = (By.XPATH, '//td[contains(@class,"next-month")]//span[contains(text(),"{}")]')
    # 点击时间确定按钮
    audit_day_confirm_btn = (By.XPATH, '//button[contains(@class,"el-button--mini")]/span[contains(text(),"确定")]')
    # 点击查询
    audit_btn_query = (By.CLASS_NAME, "find")
    # 通过按钮
    audit_btn_pass = (By.XPATH, '//button[contains(@class,"el-button--default")]/span[text()="通过"]')
    # 弹窗确定按钮
    audit_pass_alert_btn = (By.CLASS_NAME, "el-button--primary")
